import 'request_config.dart';
import 'package:dio/dio.dart';


// or new Dio with a BaseOptions instance.
BaseOptions options = new BaseOptions(
    baseUrl: baseUrl,
    connectTimeout: timeOutDuration,
    receiveTimeout: timeOutDuration,
);
Dio dio = new Dio(options);

class Requset{
  static requestData(String path, String method, {Map<String, dynamic> params}) async{
    var result;
    if(method == "get" || method == "GET"){
      print("-------------------");
      result = await dio.get(baseUrl + path, queryParameters:params);
    }else if(method == "post" || method == "POST"){
      result = await dio.post(baseUrl + path, data:params);
    }
    return result;
  }
}

